#pragma once

#include <memory>
#include "Game.h"

class Window
{
public:
	Window(unsigned width, unsigned height, const char* name); 

public:
	bool Initialize(int argc, char** argv);
	void Destroy();

public:
	void BeginLoop();

public:
	unsigned width();
	unsigned height();

private:
	static void		_DisplayHandler();
	static void		_KeyboardHandlerASCII(unsigned char key, int x, int y);
	static void		_KeyboardSpecialHandler(int specialKey, int x, int y);
	static void		_ReshapeHandler(int width, int height);
	static void		_UpdateHandler(int value);
	static void		_RedrawHandler(int value);

private:
	void			_BindHandlers();

private:
	unsigned		_width;
	unsigned		_height;
	GLint			_mainWindow;
	const char*		_name;

private:
	static unsigned	_frameInterval;

private:
	static Game*	_game;
};

typedef std::tr1::shared_ptr<Window> WindowPtr;